﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace l1cs.server.serverpackets
{
    public class S_Sound : ServerBasePacket
    {
        private byte[] _byte = null;

        /**
         * 効果音を鳴らす(soundフォルダのwavファイル)。
         * @param sound
         */
        public S_Sound( int sound )
        {
            buildPacket( sound );
        }

        private void buildPacket( int sound )
        {
            writeC( Opcodes.S_OPCODE_SOUND );
            writeC( 0 ); // repeat
            writeH( sound );
        }

        override
        public byte[] getContent()
        {
            if ( _byte == null )
            {
                _byte = getBytes();
            }
            return _byte;
        }

        override
        public String getType()
        {
            return "[S] S_Sound";
        }
    }
}
